package cn.xinfei.xdecision.common.dao.datax.datainterface.v2;
import java.util.Collection;
import java.util.List;

import cn.xinfei.xdecision.common.model.datax.datamanage.v2.vo.VariableInterfaceVO;
import org.apache.ibatis.annotations.Param;

import cn.xinfei.xdecision.common.model.datax.datainterface.v2.VariableInterface;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;

@Mapper
public interface VariableInterfaceMapper extends BaseMapper<VariableInterface>{

    List<VariableInterface> selectAllByVariableCodes(@Param("varCodes") Collection<String> varCodes);

    List<Long> selectDatasourceIdsByVariableCodes(@Param("varCodes") Collection<String> varCodes);

    List<String> searchApiListByDatasourceId(@Param("dataSourceId") Integer datasourceId);

    List<VariableInterface> searchAllByDatasourceId(@Param("datasourceId") Integer datasourceId);

    List<VariableInterface> searchVariableCodesByApi(@Param("api") String api);

    List<Long> selectDatasourceIdsByVarCodes(@Param("varCodes")Collection<String> varCodes);

    List<String> selectApiByDatasourceId(@Param("datasourceId") Integer datasourceId);

    Long selectDatasourceIdByApi(@Param("api") String api);

    void batchInsertOrUpdateVariables(@Param("variableInterfaces") List<VariableInterface> variableInterfaces);

    void save(VariableInterfaceVO variableInterface);

    void update(VariableInterfaceVO variableInterface);

    List<String> selectVarCodesByProviderAndOrganId(@Param("provider") String provider, @Param("organId") Long organId);

}


